<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //模板字符串
        var s1 = "哈哈哈"
        var s2 = "呵呵呵呵"
        var str = `<h1>${s1}</h1><h2>${s2}</h2>`
        var str1 = '<h1>' + s1 + '</h1><h2>' + s2 + '</h2>'
        console.log(str);
        console.log(str1);
        //字符串新增的方法
        var m = "8"
        var mm = m.padStart(2, "0")
        console.log(mm);
        console.log(m.padEnd(2, "0"));
        //10 10.00
        //10.0 10.00
        //10.01 10.01
        console.log("aaa.jpg.png".endsWith(".jpg"));
        var d = new Date()
        var month = ((d.getMonth() + 1).toString().padStart(2, 0))
        console.log(month, typeof month);
    </script>
</body>

</html>